-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Fix performance issue in liveness checking #151376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. r=me with green perf
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (3a8fd6c): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (secondary 3.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.058s -> 474.35s (0.27%) |
|
@bors r=lqd |
|
It didn’t fix the issue you were trying to fix, right? |
seems that PR #150955 don't have that big performance regression: |
|
It doesn't indeed. |
|
In any case, this new code is in a good spot now (but it's also not clear that it was causing much in the previous place) so let's land it. |
| // By convention, underscore-prefixed bindings are explicitly allowed to be unused. | ||
| if name.as_str().starts_with('_') { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is inside the loop, so this lookup can be done multiple times after this change, right? Could that be the issue?
For positive cases we can also just break, too.
| // By convention, underscore-prefixed bindings are explicitly allowed to be unused. | |
| if name.as_str().starts_with('_') { | |
| continue; | |
| } | |
| // By convention, underscore-prefixed bindings are explicitly allowed to be unused. | |
| if name.as_str().starts_with('_') { | |
| break; | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw that but the only way this would matter is if the benchmarks code emits unused warnings today, and we'd be thus benchmarking diagnostics?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, right. I guess I'm just perplexed by the results. For code that never emitted these warnings, this PR should be strictly less work, because they never reach this branch anyway, but instead it's a regression. That doesn't make any sense to me. At least it should undo the previous regression in unicode-normalization, but those benchmarks didn't move above the treshold, or slightly regressed, if anything (I'm assuming unicode-normalization doesn't emit unused-assignemnts).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
were you able to check @chenyukang? break makes sense to us, but the results are also strange: not knowing whether they impact benchmarks unexpectedly due to diagnostics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, seems better, updated the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what did you learn, are we unexpectedly looking at codepaths that are only exercised through diagnostics emitted by the benchmarks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break seems more efficient in theory, but no performance improvement in practice, i think diagnostics emitting is general not in hotpath, don't understand why #150955 (comment) happened, this PR should make sure name.as_str().starts_with('_') only executed when there is an error, but #151376 (comment) makes no change.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking r? @ghost from #150955 (comment)
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 399f6ba failed: CI. Failed job:
|
|
There error is @bors try jobs=x86_64-gnu-aux |
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking try-job: x86_64-gnu-aux
54f9a44 to
abf0f4a
Compare
This comment has been minimized.
This comment has been minimized.
abf0f4a to
441cba2
Compare
441cba2 to
d2aa64f
Compare
|
anyway, let's run a perf again @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (98437b3): comparison URL. Overall result: no relevant changes - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 545.612s -> 476.413s (-12.68%) |
|
Great, no noise, @bors r+ rollup |
…uwer Rollup of 4 pull requests Successful merges: - #151376 (Fix performance issue in liveness checking) - #151851 (Remove redundant `IntoQueryParam` calls from query plumbing) - #151854 (Show break type expectation cause for let-else) - #151859 (Disable append-elements.rs test with debug assertions)
Rollup merge of #151376 - chenyukang:yukang-fix-perf, r=lqd Fix performance issue in liveness checking r? @ghost from #150955 (comment)
r? @ghost
from #150955 (comment)